package cn.tedu.charging.order.controller;



import cn.tedu.charging.order.pojo.parame.OrderAddParam;
import cn.tedu.charging.common.result.JsonResult;
import cn.tedu.charging.order.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/order/")
@Api(tags = "订单模块")
public class OrderController {

    @Autowired
    private OrderService orderService;


    @PostMapping("add")
    @ApiOperation(value = "生成订单")
    public JsonResult<String> addOrder(@RequestBody OrderAddParam orderAddParam){
        log.info("生成订单参数：orderAddParam={}",orderAddParam);
        orderService.addOrder(orderAddParam);
        return JsonResult.ok();
    }
}
